< previous page page_741 next page >

Page 741
    '
    Dim intResult As Integer
    Dim lngBufferLen As Long
    '
    intResult = SQLGetData(hStmt, intCol, sqlChar, strBuffer, BUFFERLEN,
lngBufferLen)
    If intResult <> sqlSuccess Then
        GetColumn = intResult
        Err.Raise vbObjectError + 15, App.EXEName, "Error retrieving column
data"
        Exit Function
    Else
        If lngBufferLen > 0 Then
            strBuffer = Left(strBuffer, lngBufferLen)
        Else
            strBuffer = ""
        End If
    End If
    '
    GetColumn = sqlSuccess
    '
End Function
Now, add the SaveColumn method in Listing 19.15 to the class.
Type.gifListing 19.15. Adding the SaveColumn method to the class.
Private Sub SaveColumn(strRow As String, strColumn As String)
    '
    ' add column to row line
    '
    If Trim(strColumn) <> "" Then
         If Trim(strRow) = "" Then
            strRow = "||" & Trim(strColumn) ' mark first field
        Else
            strRow = strRow & "|" & (strColumn)
        End If
    Else
        strRow = strRow & "|"
    End If
    '
End Sub
This routine just copies the retrieved column data into a hold variable. The marking values "||" (for a new record) and "|" (for a new field) are used to retrieve the data from local storage to the caller's data-input form controls later.
Now add the code in Listing 19.16 to the class. This is the SaveRow method. This is the code that copies the complete line of data into the rich textbox control for storage.

 
< previous page page_741 next page >

If you like this book, buy it!